package com.yc.system.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.yc.framework.baseClass.BaseEntity;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import com.yc.framework.config.CustomFloatDeserializer;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import lombok.experimental.Accessors;

/**
 * <p>
 * 图书信息表
 * </p>
 *
 * @author 1850140986@qq.com
 * @since 2022-12-03
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Accessors(chain = true)
@TableName("t_book")

public class Book extends BaseEntity<Book>{
    private static final long serialVersionUID = 1L;

    /**
     * 图书ID
     */
    @TableId(value = "book_id", type = IdType.AUTO)
    private Integer bookId;

    /**
     * 书籍名称
     */
    @TableField("book_name")
    private String bookName;

    /**
     * 书籍类型ID
     */
    @TableField("type_id")
    private Integer typeId;

    /**
     * 发布者ID
     */
    @TableField("user_id")
    private Integer userId;

    /**
     * 出版社
     */
    @TableField("publisher")
    private String publisher;

    /**
     * 作者
     */
    @TableField("author")
    private String author;

    /**
     * 原价
     */
    @TableField("f_price")
    @JsonDeserialize(using = CustomFloatDeserializer.class)
    private Float fPrice;

    /**
     * 价格
     */
    @TableField("n_price")
    @JsonDeserialize(using = CustomFloatDeserializer.class)
    private Float nPrice;

    /**
     * 折扣
     */
    @TableField("discount")
    @JsonDeserialize(using = CustomFloatDeserializer.class)
    private Float discount;

    /**
     * 折扣
     */
    @TableField(exist = false)
    @JsonDeserialize(using = CustomFloatDeserializer.class)
    private Float price;

    /**
     * 折损
     */
    @TableField("depreciation")
    private Integer depreciation;

    /**
     * 出版日期
     */
    @TableField("pub_date")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date pubDate;

    /**
     * 关键词
     */
    @TableField("keyword")
    private String keyword;

    /**
     * 封面
     */
    @TableField("cover_photo")
    private String coverPhoto;

    /**
     * ISBN
     */
    @TableField("isbn")
    private String isbn;

    /**
     * 简介
     */
    @TableField("brief")
    private String brief;

    /**
     * 库存量
     */
    @TableField("quantity")
    private Integer quantity;

    /**
     * 销量
     */
    @TableField("sell_num")
    private Integer sellNum;

    /**
     * 收藏数量
     */
    @TableField("like_num")
    private Integer likeNum;

    /**
     * 图书状态   1普通用户 售卖； 5 swiper ；2售完，3预定
     */
    @TableField("book_status")
    private Integer bookStatus;

    /**
     * 上架时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField("added_time")
    private Date addedTime;



}